    var swiperscrollbar = new Swiper('.swiperscrollbar', {
        direction: 'vertical',
        slidesPerView: 'auto',
        scrollbar: {
            el: '.swiper-scrollbar-gundong',
            // draggable: true,
        },
        freeMode: true,
        mousewheel: true,
    });
    $('#sitecontent').css('height', $(window).height());
    $('#head').css('height', $(window).height());
    $('#head').css('width', $(window).width() * 0.802);
    $('#backgroundimg').css('width', $(window).width() * 0.802);
    $('#backgroundimg').css('height', $(window).height());
    $('#backgroundimg1').css('width', $(window).width() * 0.802);
    $('#backgroundimg1').css('height', $(window).height());
    $('.page_body').css('height', $(window).height());
    $('.fuwus').css('display', 'none');
    $('.ges.swiper-slide.diers').css('height', $(window).height());


    //窗口改变触发的函数
    window.onresize = function (e) {
        //浏览器改变的时候会触发这个事件
        $('.page_body').css('height', $(window).height());

        $('#backgroundimg').css('width', $(window).width() * 0.802);
        $('#backgroundimg').css('height', $(window).height());
        $('#backgroundimg1').css('width', $(window).width() * 0.802);
        $('#backgroundimg1').css('height', $(window).height());
        //获取当前浏览器宽度
        $('#head').css('height', $(window).height());
        $('#head').css('width', $(window).width() * 0.802);
        $('#sitecontent').css('height', $(window).height());
    }
    $(document).ready(function () {
        //循环执行，每隔1秒钟执行一次 1000 
        var s = 0;
        setInterval(function () {
            s = s + 0.001;
            if (s >= 1) {
                // $('#backgroundimg').css('opacity', 1);
                // $('#backgroundimg1').css('opacity', 0);
                if (s < 2) {
                    $('#backgroundimg').css('opacity', s - 1);
                    $('#backgroundimg1').css('opacity', 2 - s);
                } else {
                    s = 0
                }
            } else {
                $('#backgroundimg').css('opacity', 1 - s);
                $('#backgroundimg1').css('opacity', s);
            }
        }, 1)
        //去掉定时器的方法 window.clearInterval(t1);
    });

    function weibo(title) { //3个参数：1要分享的内容，2分享的地址，3appkey
        var txtVal = "有任何需要，快来联系先剑吧";
        var url = window.location.href;
        window.open("http://v.t.sina.com.cn/share/share.php?appkey=4120396272&title=" + encodeURIComponent(
                txtVal) +
            "&url=" + encodeURIComponent(url));
    }

    function funwechat() {
        if ($('.fixd_wechat').hasClass('active')) {
            $('.fixd_wechat').removeClass('active')
        } else {
            $('.fixd_wechat').addClass('active')
        }
    }
    $('.fixd_wechat').on('click', function () {
        if ($('.fixd_wechat').hasClass('active')) {
            $('.fixd_wechat').removeClass('active')
        } else {
            $('.fixd_wechat').addClass('active')
        }
    })
    window.onload = function () {
        var indexpage = new Swiper('.swiper-container-indexpage', {
            direction: 'vertical',
            // mousewheel: true,
            threshold: 100,
            on: {
                init: function () {
                    swiperAnimateCache(this); //隐藏动画元素 
                    swiperAnimate(this); //初始化完成开始动画
                },
                slideChangeTransitionEnd: function () {
                    swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
                    // this.slides.eq(this.activeIndex).find('.ani').removeClass('ani');
                    $('#nav .navitem a').removeClass('active');
                    $('#nav .navitem').eq(indexpage.activeIndex).find('.nav-a').addClass('active');
                }
            }
        })


        $('#nav .navitem').on('click', function (event) {
            $('#fuwu').css('display', 'none');
            $('#nav .navitem a').removeClass('active');
            $(this).find('.nav-a').addClass('active');
            if ($(this).index() == 1) {
                aboutSwiper.slideTo(0, 500);
            }
            indexpage.slideTo($(this).index(), 500);
            $('.fuwus').css('display', 'none');
            $('.pingyi').css('display', 'block');
            event.preventDefault()
            return false;
        })
        //服务分类
        $('.fenlei .zifenlei').on('click', function () {
            $('.fenlei .zifenlei').removeClass('active');
            $(this).addClass('active');
            $('.cont').css('display', 'none');
            $('.cont' + $(this).index()).css('display', 'block');

        });
        $('.navitem.index_sub2 .subnav li').on('click', function (event) {
            $('.pingyi').css('display', 'none');
            $('.fuwus').css('display', 'none');
            $('.fuwu' + $(this).index()).css({
                'display': 'block',
                'position': 'absolute',
                'z-index': '111'
            });
            $('.fenlei .zifenlei').removeClass('active');
            $('.fuwu' + $(this).index()).find('.fenlei .zifenlei').eq(0).addClass('active');
            indexpage.slideTo(2, 500);
            event.stopPropagation();
        })
        $('.pingyi .swiper-slide').on('click', function () {
            console.log($(this).index());
            $('.pingyi').css('display', 'none');
            $('.fuwus').css('display', 'none');
            $('.fuwu' + $(this).index()).css({
                'display': 'block',
                'position': 'absolute',
                'z-index': '111'
            });
        })

        // about
        var aboutSwiper = new Swiper('.aboutSwiper', {
            observer: true,
            observeParents: true,
            effect: 'fade',
            threshold: 100,
            navigation: {
                nextEl: '.yous',
                prevEl: '.zuos',
            },
            on: {
                init: function () {
                    swiperAnimateCache(this); //隐藏动画元素 
                    swiperAnimate(this); //初始化完成开始动画
                },
                slideChangeTransitionEnd: function () {
                    swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
                },
                transitionEnd: function () {
                    linianSwiper.slideTo(aboutSwiper.activeIndex, 500);
                }
            },
            pagination: {
                el: '.swiper-paginations',
                clickable: true,
                renderBullet: function (index, className) {
                    return '<span class="' + className + '">0' + (index + 1) + '</span>';
                },
            },
        });
        aboutSwiper.slideTo(2, 500);
        $('.navitem.index_sub1 .sub0').on('click', function (event) {
            indexpage.slideTo(1, 500);
            aboutSwiper.slideTo(0, 500);
            event.stopPropagation();
        })
        $('.navitem.index_sub1 .sub1').on('click', function (event) {
            indexpage.slideTo(1, 500);
            aboutSwiper.slideTo(1, 500);
            event.stopPropagation();
        })

        $('.fixg').css({
            'display': 'none'
        });

        var linianSwiper = new Swiper('.linian', {
            observer: true,
            observeParents: true,
            effect: 'fade',
            pagination: {
                el: '.pagss',
            },
            on: {
                transitionEnd: function () {
                    aboutSwiper.slideTo(linianSwiper.activeIndex, 500);
                }
            }
        })
    }


    // 服务

    var pingyi = new Swiper('.pingyi', {
        observer: true,
        observeParents: true,
        slidesPerView: 4.3,
        autoplay: {
            delay: 6000,
            stopOnLastSlide: false,
            disableOnInteraction: false,
        },
    })



    //招聘下
    var swiperzhaoping = new Swiper('.swiper-container-zhaoping', {
        observer: true,
        observeParents: true,
        slidesPerView: 2.3,
        threshold: 50,
    })

    $('.di .swiper-container-zhaoping .swiper-slide').on('click', function () {
        $('.di .swiper-container-zhaoping .swiper-slide').removeClass('active');
        $(this).addClass('active');
        // swiperyous.slideTo($(this).index(), 500);
        swiperzhaoping.slideTo($(this).index(), 500);
    })
    $(".cen_zhong").mousedown(function () {
        $(".cen_zhong").css({
            '': ''
        });
    });
    $('.cen_zhong').on('click', function () {

        if (swiperyous.activeIndex == $('.swiper-container-yous .swiper-wrapper .swiper-slide').length - 1) {
            swiperyous.slideTo(0, 500);
            // swiperzhaoping.slideTo(0, 500);
            swiperwensu.slideTo(0, 500);
        } else {
            swiperyous.slideNext();
            // swiperzhaoping.slideNext();
            swiperwensu.slideNext();
        }

    })
    //招聘右
    if ($('.swiper-container-yous .swiper-wrapper .swiper-slide').length < 10) {
        $('.nums2').text('0' + $('.swiper-container-yous .swiper-wrapper .swiper-slide').length);
    } else {
        $('.nums2').text($('.swiper-container-yous .swiper-wrapper .swiper-slide').length);
    }
    var swiperyous = new Swiper('.swiper-container-yous', {
        direction: 'vertical',
        observer: true,
        observeParents: true,
        scrollbar: {
            el: '.swiper-scrollbar-yous',
            hide: true,
        },
        on: {
            transitionEnd: function () {
                if (swiperyous.activeIndex < 10) {
                    $('.nums1').text('0' + (swiperyous.activeIndex + 1));
                    // $('.di .swiper-container-zhaoping .swiper-slide').removeClass('active');
                    // $('.di .swiper-container-zhaoping .swiper-slide').eq(swiperyous.activeIndex).addClass('active');
                    swiperwensu.slideTo(swiperyous.activeIndex, 500);
                    // swiperzhaoping.slideTo(swiperyous.activeIndex, 500);
                } else {
                    $('.nums1').text(swiperyous.activeIndex + 1);
                    // $('.di .swiper-container-zhaoping .swiper-slide').removeClass('active');
                    // $('.di .swiper-container-zhaoping .swiper-slide').eq(swiperyous.activeIndex).addClass('active');
                    // swiperzhaoping.slideTo(swiperyous.activeIndex, 500);
                    swiperwensu.slideTo(swiperyous.activeIndex, 500);
                }
            }
        }
    });


    //招聘左


    var swiperwensu = new Swiper('.swiper-container-wensu', {
        direction: 'vertical',
        observer: true,
        observeParents: true,
        on: {
            init: function (swiper) {
                slide = this.slides.eq(0);
                slide.addClass('ani-slide');
            },
            transitionStart: function () {
                for (i = 0; i < this.slides.length; i++) {
                    slide = this.slides.eq(i);
                    slide.removeClass('ani-slide');
                }
            },
            transitionEnd: function () {
                slide = this.slides.eq(this.activeIndex);
                slide.addClass('ani-slide');

                if (this.activeIndex < 10) {
                    swiperyous.slideTo(this.activeIndex, 500);
                } else {
                    swiperyous.slideTo(this.activeIndex, 500);
                }

            },
        }
    });

    // 文件上传
    $('.scwj').on('click', function () {
        $('#xzwj').trigger('click');
    });
    $('.close').on('click', function () {
        $('.sqzw').css({
            'display': 'none'
        })
    })
    $('.closed').on('click', function () {
        $('.bacs').css({
            'display': 'none'
        })
    })
    $('.bacs3').on('click', function () {
        $('.closed').trigger('click');
    })

    function wytg() {
        $('.sqzw').css({
            'display': 'block'
        })
    }

    function upload() {
        var formData = new FormData();
        formData.append("file", $("#xzwj")[0].files[0]);
        $.ajax({
            url: "###", //请求接口链接
            type: 'post', //请求类型 get post put .....
            dataType: "json",
            data: formData,
            processData: false,
            contentType: false,
            success: function (res) {
                if (res.code == 1) {
                    $('#file').val(res.url);
                    var index = $('#file').val();
                    if (index != null) {
                        $('.scwj').html("文件已上传");
                    }
                } else {
                    $('#xzwj').val('');
                }
            },
            error: function () {
                console.log('网络错误');
            }
        })
    }

    function checkForm() {
        var name = document.getElementById('name').value;
        var tel = document.getElementById('tel').value;
        var content = document.getElementById('content').value;
        var file = document.getElementById('file').value;
        var index = document.getElementById('xzwj').value;
        var len = 0;
        for (var i = 0; i < name.length; i++) {
            var a = name.charAt(i);
            if (a.match(/[^\x00-\xff]/ig) != null) {
                len += 2;
            } else {
                len += 1;
            }
        }
        if (name.trim() == null || name.trim() == "" || len < 4) {
            $(".yuyue").css("display", "block");
            $("#text").text("信息填写有误");
            $("#desc").text("请填写2个字符以上的姓名");
            $(".sqzws2").text("重新填写");
            $('.sqzws2').on('click', function () {
                $('.closed').trigger('click');
            })
            return false;
        } else if (!(/^1[34578]\d{9}$/.test(tel))) {
            $(".yuyue").css("display", "block");
            $("#text").text("信息填写有误");
            $("#desc").text("请填写11位数字的有效电话号码");
            $(".sqzws2").text("重新填写");
            $('.sqzws2').on('click', function () {
                $('.closed').trigger('click');
            })
            return false;
        } else {
            var data = {
                'name': name,
                'tel': tel,
                'content': content,
                'file': file
            };
            console.log(data);
        }
    }



    //联系我们

    var hzhb = new Swiper('.hzhb', {
        observer: true,
        observeParents: true,
        threshold: 50,
        // on: {
        //     init: function (swiper) {},
        //     transitionEnd: function () {
        //         slide = this.slides.eq(this.activeIndex);
        //         slide.addClass('ani-slide');

        //         if (this.activeIndex < 10) {
        //             swiperyous.slideTo(this.activeIndex, 500);
        //         } else {
        //             swiperyous.slideTo(this.activeIndex, 500);
        //         }

        //     },
        // }
    })

    $('.lef').on('click', function () {
        if (hzhb.activeIndex == $('.hzhb .swiper-wrapper .swiper-slide').length - 1) {
            hzhb.slideTo(0, 500);
        } else {
            hzhb.slideNext();
        }
    })
    $('.hzhb ul li div').on('click', function () {
        $('.hzhb ul li div').removeClass('active');
        $(this).addClass('active');
    })